<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div style="display: none"><script id="myEditorImageAiticle" type="text/plain"></script></div> 
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="pageContent">
	<form method="post" action="${rootUrl}/info/article/${article.id}" class="pageForm required-validate" onsubmit="return beforeSubmit(this);">
		<c:if test="${article.id != 0 && article.id != '' }"><input type="hidden" name="_method" value="put"></c:if>
		<input type="hidden" name="article.id" value="${article.id }">
		<div class="pageFormContent">
			<p>
				<label>文章标题：</label>
				<input name="article.title" class="required" type="text" size="30" value="${article.title }" />
			</p>
			<p>
				<label>文章类别：</label>
				<input type="hidden" id="orgLookup.id" name="orgLookup.id" value="${article.articleClass.id }" readonly="readonly">
				<input type="text" id="orgLookup.name" name="orgLookup.name" class="required" value="${article.articleClass.name }" readonly="readonly">
				<a class="btnLook" href="${rootUrl}/info/article-class/1/showAll?article_id=${article.id}" lookupGroup="orgLookup">文章类别</a>
			</p>

			<p>
				<label>是否展示：</label>
				<select name="article.isShow" class="required combox" >
					<option <c:if test="${article.isShow == 1}">selected="selected"</c:if> value="1">是</option>
					<option <c:if test="${article.isShow == 0}">selected="selected"</c:if> value="0">否</option>
				</select>
			</p>
			<dl class="nowrap">
				<dt>文章图片：</dt>
				<dd>
				<input name="article.url" id="article_img_url"  type="hidden" size="30" value="${article.url}" />
				<div class="imgContainer"><a href="#" onclick="iFileUploader.upImg('article_img_url','article_img');"><img id="article_img" src="${article.url}" /></a></div>
				</dd>
			</dl>
   		 </div>
   		 <p>
			&nbsp;&nbsp;&nbsp;<label>文章内容：</label>
		 </p>
   		 <div class="pageFormContent" layoutH="265" style="z-index:1;">
   		 	<div style="height: 100%;">
				<script id="ueditor" name="article.content" type="text/plain">
					${article.content}
				</script>
			</div>
    	</div>
    	<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button id="theSubmit" type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
    </form>
    	
</div>
    <script type="text/javascript">
    
        var articleImageFolder = 2;
    	var pHeight = $("#ueditor").parent().css("height");
    	var editor = new UE.ui.Editor({initialFrameHeight:450,initialFrameWidth:'100%'});
    	editor.render("ueditor");
    	editor.ready(function(){
    		this.execCommand('serverparam', 'imageFolder', articleImageFolder);
    	});
    	iFileUploader.initImg("myEditorImageAiticle","article_img_url","article_img",{imageFolder:articleImageFolder});
    	function beforeSubmit(obj){
		$("#orgLookup.id").attr("name","article.articleClass.id");
		$("#orgLookup.name").attr("name","article.articleClass.name");
		return validateCallback(obj, newDialogAjaxDone);
	}
    </script>
